package com.kit.personalkit.security;

import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

//因为父类中有构造方法 此时添加@Data会让当前类添加构造方法,此方法可能会和父类的冲突所以报错
@Getter
public class CustomUserDetails extends User {
    private Integer userId;
    private String userName;
    private String password;
    private String avatarUrl;  //头像路径
    private Integer status; //用户状态 1:正常 0:封禁
    private Integer userType;  //用户类型 1:用户 0:管理员
    public CustomUserDetails(Integer userId,String userName,
                             String password, String avatarUrl,
                             Integer status,Integer userType,
                             Collection<? extends GrantedAuthority> authorities) {
        super(userName, password, authorities);
        this.userId = userId;
        this.userName = userName;
        this.password = password;
        this.avatarUrl = avatarUrl;
        this.status = status;
        this.userType = userType;
    }
}
